Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xtask #2688

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Xtask #2688

wants to merge 7 commits into from

Conversation

egithinji
Copy link
Contributor

Background

Comprehensive Rust requires a number of tools to be installed (e.g. mdbook and mdbook-course). As mentioned in #2509 (and discussed in #2469) it would be nice to have a cross platform command for installing these dependencies. Currently these are installed using a shell script (install-mdbook.sh) but this isn't truly cross platform e.g. for Windows users.

Xtask

xtask outlines an approach for automating tasks in a Rust project. It involves using cargo's aliasing feature to allow us to run commands like cargo xtask <some task> to perform adhoc tasks via a Rust binary that we might otherwise need a shell script for.

In this PR we add support for a cargo xtask install-tools command that will replace the install-mdbook.sh script and install the dependent tools. We can potentially extend it to support for other tasks e.g. cargo xtask fmt.

Eric Githinji added 3 commits March 3, 2025 06:59
This follows the approach in https://github.com/matklad/cargo-xtask and
allow us to run `cargo xtask install-tools` from the project root to
install the tools that comprehensive rust depends on, rather than
using a bash script which is not truly cross platform.
@michael-kerscher
Copy link
Collaborator

Hi @egithinji. Thank you very much for drafting this pull request! I really like the idea of having this cross platform task execution tool!
I can already think of an additional use case for this. We have a test framework that is testing the generated website and currently needs to be executed manually in the tests subdirectory. Maybe it makes sense to include such tasks as well (not in this PR though, this is a idea for future work)

@egithinji
Copy link
Contributor Author

Hi @egithinji. Thank you very much for drafting this pull request! I really like the idea of having this cross platform task execution tool! I can already think of an additional use case for this. We have a test framework that is testing the generated website and currently needs to be executed manually in the tests subdirectory. Maybe it makes sense to include such tasks as well (not in this PR though, this is a idea for future work)

Thanks @michael-kerscher for reviewing! Yes that sounds like a good candidate for an additional task. Happy to collaborate on this further.

Copy link
Collaborator

@michael-kerscher michael-kerscher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants